package com.hsj.goldstore.mvp.present;

import com.hsj.goldstore.base.BaseMvpPresent;
import com.hsj.goldstore.base.ResultCallback;
import com.hsj.goldstore.mvp.model.LoginModel;
import com.hsj.goldstore.mvp.view.MainView;

/**
 * Created by Administrator on 2018/3/21.
 */

public class MainPresent extends BaseMvpPresent<MainView> implements IMainPresent {
    private LoginModel loginModel;

    public MainPresent() {
        loginModel = new LoginModel();
    }


    public void init() {
        //检查是否绑定view
        checkViewAttach();
    }

    @Override
    public void showStore() {

        loginModel.login("10086", "123123", new ResultCallback() {
            @Override
            public void onSuccess(Object data, int code, String msg) {
                mvpView.showDataResult(msg);
            }

            @Override
            public void onFalure(int code, String err) {
                mvpView.showError(err);
            }
        });
    }

    @Override
    public void showGoods() {

    }

    @Override
    public void showMy() {

    }


}
